package mblog.core.persist.service.impl;

import mblog.core.data.AccessLog;
import mblog.core.persist.dao.AccessLogDao;
import mblog.core.persist.entity.AccessLogPO;
import mblog.core.persist.service.AccessLogService;
import mblog.core.persist.utils.BeanMapUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * Project  : mblog
 * Author   : Wu Tian Qiang
 * Date     : 2016/6/14
 */
@Service
public class AccessLogServiceImpl implements AccessLogService {

    @Autowired
    private AccessLogDao accessLogDao;

    @Override
    @Transactional
    public void add(AccessLog accessLog) {
        AccessLogPO accessLogPO = new AccessLogPO();
        BeanUtils.copyProperties(accessLog, accessLogPO);

        accessLogDao.save(accessLogPO);
    }
}
